#pragma once

#include <engine.core/noncopyable.hpp>

#include "exports.hpp"
#include "Item.hpp"




/**
 * The IDatabaseWriter defines the interface any writer is required to implement,
 * in order to serialize a Database again. This may not be useful for the actual game,
 * but propably great when developing tools that work with the Database.
 */
class ENGINE_DATABASE_API DatabaseWriter : public noncopyable
{
public:

	typedef DatabaseItem::Properties   Properties;

public:

	DatabaseWriter() {}
	virtual ~DatabaseWriter() {}



	/**
	 * Writes the given item to the sink.
	 * The actual implementation should write in the same format, as
	 * the reader for that extension, in order to work properly.
	 */
	virtual void write(const STRICT_PTR(DatabaseItem)& item)= 0;
};
///////////////////////////////////////////////////////////////////////////////////////////////////

DEFINE_STRICT_PTR(DatabaseWriter);
